<template>
	<view class="container">
		<view class="head-wrap" style=" height: 90rpx;">
		    <u-sticky bgColor="#fff">
		       <u-tabs lineWidth="40px" lineColor="#f39e00" :list="titleList" @click="tabsClick" :current="tabIndex">
				   
			   </u-tabs>
		    </u-sticky>
		</view>
		<block v-if="titleList.length > 0">
		<swiper :style="{ height: height }" :current="tabIndex" @change="swiperChange">
		    <swiper-item v-for="(tab, i) in titleList" :key="i">
		        <mescroll-item
		            ref="mescrollItem"
		            :i="i"
		            :index="tabIndex"
		            :tabs="titleList"
					:tabObj="tab"
		        ></mescroll-item>
		    </swiper-item>
		</swiper>
		</block>
	</view>
</template>

<script>
	import MescrollItem from './video-swiper-item.vue';
	
	export default {
		components: {
		    // uniTag,
		    MescrollItem,
		},
		// mixins: [list],
		data() {
			return {
				titleList:[
					{
						id:'0',
						status:'all',
						name:'全部',
					},
					{
						id:'1',
						status:'2',
						name:'临沂',
					},
					{
						id:'2',
						status:'5',
						name:'日照',
					} 
				], 
				tabIndex:0,
				height:0,
				lists:[
					{
						'title':'1zswlx.png',
						'image':'/static/home/zswlx.png',
						'sub':'/static/home/zswlx.png',
						'time':'2023-02-03'
					},
					{
						'title':'2zswlx.png',
						'image':'/static/home/zswlx.png',
						'sub':'/static/home/zswlx.png',
						'time':'2023-02-03'
					},
					{
						'title':'3zswlx.png',
						'image':'/static/home/zswlx.png',
						'sub':'/static/home/zswlx.png',
						'time':'2023-02-03'
					},
					{
						'title':'4zswlx.png',
						'image':'/static/home/zswlx.png',
						'sub':'/static/home/zswlx.png',
						'time':'2023-02-03'
					}
				]
			}
		},
		onLoad(options) {
			 this.height = uni.getSystemInfoSync().windowHeight  + 'px'
		},
		methods: {
			tabsClick(item){
						 this.tabIndex = item.index;
			},
			swiperChange(e){
						 this.tabIndex = e.detail.current
			},
		}
	}
</script>

<style lang="scss">
@import '../public/css/video.scss';
</style>
